<div id="order-pay-dialog" class="order-pay-dialog-c" style="width:380px;">
<h3><span id="order-pay-dialog-close" class="close" onclick="return X.boxClose();">关闭</span><!--{if !empty($_GET['mobile'])}-->重新绑定<!--{else}-->绑定手机<!--{/if}--></h3>
	<p class="info" id="bindmobile-dialog-display-id">请您输入手机号然后点击“获取”<br/>链接进行获取短信绑定验证码操作！</p>
	<p class="notice">手机号：<input id="bindmobile-dialog-input-mobile" type="text" name="mobile" class="f-input" style="text-transform:uppercase;" maxLength="12" value="{$_GET['mobile']}" /></p>
	<p class="notice">验证码：<input id="bindmobile-dialog-input-verifycode" type="text" name="verifycode" style="text-transform:uppercase;" class="f-input" maxLength="6" />&nbsp;&nbsp;<a href="javascript:;" onclick="getverifycode2();"><font color="red"><b>获取</b></font></a></p>
	<p class="act" align="center"><input id="bindmobile-dialog-query" class="formbutton" value="提交" name="query" type="submit" onclick="bindmobile_submit();"/></p>
</div>

<script type="text/javascript">
function getverifycode2() {
	var mobile = trim(jQuery('#bindmobile-dialog-input-mobile').val());
	if(mobile == '') {
		alert('手机号不能为空');
		jQuery('#bindmobile-dialog-input-mobile').focus();
	} else {
		X.get(WEB_ROOT + '/ajax/sms.php?action=getverifycode2&mobile='+mobile+'&r='+ Math.random());
	}
}

function bindmobile_submit() {
	var mobile = trim(jQuery('#bindmobile-dialog-input-mobile').val());
	var verifycode = trim(jQuery('#bindmobile-dialog-input-verifycode').val());
	if(mobile == '') {
		alert('手机号不能为空');
		jQuery('#bindmobile-dialog-input-mobile').focus();
	} else if(verifycode == '') {
		alert('验证码不能为空');
		jQuery('#bindmobile-dialog-input-verifycode').focus();
	} else {
		X.get(WEB_ROOT + '/ajax/sms.php?action=bindmobile_submit&mobile='+mobile+'&verifycode='+verifycode+'&r='+ Math.random());
	}
}

function trim(str) {
	return str.replace(/^\s*(.*?)[\s\n]*$/g, '$1');
}
</script>